using System;
using System.Text;

namespace RealState.BusinessObjects
{
	[Serializable()]
	public class Districts
	{
		private int _Id;

		public int Id
		{
			get { return _Id; }
			set { _Id = value; }
		}

		private string _DistrictName;

		public string DistrictName
		{
			get { return _DistrictName; }
			set { _DistrictName = value; }
		}

		private int _CityID;

		public int CityID
		{
			get { return _CityID; }
			set { _CityID = value; }
		}

		private Nullable<int> _IsPublish;

		public Nullable<int> IsPublish
		{
			get { return _IsPublish; }
			set { _IsPublish = value; }
		}

		private Nullable<int> _Sorted;

		public Nullable<int> Sorted
		{
			get { return _Sorted; }
			set { _Sorted = value; }
		}

		public Districts()
		{ }

		public Districts(int Id,string DistrictName,int CityID,Nullable<int> IsPublish,Nullable<int> Sorted)
		{
			this.Id = Id;
			this.DistrictName = DistrictName;
			this.CityID = CityID;
			this.IsPublish = IsPublish;
			this.Sorted = Sorted;
		}

		public override string ToString()
		{
			return "Id = " + Id.ToString() + ",DistrictName = " + DistrictName + ",CityID = " + CityID.ToString() + ",IsPublish = " + IsPublish.ToString() + ",Sorted = " + Sorted.ToString();
		}

		public class IdComparer : System.Collections.Generic.IComparer<Districts>
		{
			public SorterMode SorterMode;
			public IdComparer()
			{ }
			public IdComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Districts> Membres
			int System.Collections.Generic.IComparer<Districts>.Compare(Districts x, Districts y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Id.CompareTo(x.Id);
				}
				else
				{
					return x.Id.CompareTo(y.Id);
				}
			}
			#endregion
		}
		public class DistrictNameComparer : System.Collections.Generic.IComparer<Districts>
		{
			public SorterMode SorterMode;
			public DistrictNameComparer()
			{ }
			public DistrictNameComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Districts> Membres
			int System.Collections.Generic.IComparer<Districts>.Compare(Districts x, Districts y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.DistrictName.CompareTo(x.DistrictName);
				}
				else
				{
					return x.DistrictName.CompareTo(y.DistrictName);
				}
			}
			#endregion
		}
		public class CityIDComparer : System.Collections.Generic.IComparer<Districts>
		{
			public SorterMode SorterMode;
			public CityIDComparer()
			{ }
			public CityIDComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Districts> Membres
			int System.Collections.Generic.IComparer<Districts>.Compare(Districts x, Districts y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.CityID.CompareTo(x.CityID);
				}
				else
				{
					return x.CityID.CompareTo(y.CityID);
				}
			}
			#endregion
		}
	}
}
